"use client"
import type { Metadata } from "next";

import React, { useState } from 'react';
import { Button, Layout, Menu, theme } from 'antd';
import { usePathname,useRouter } from "next/navigation";


const { Header, Sider, Content } = Layout;


export default function RootLayout({
  children,
}: Readonly<{
  children: React.ReactNode;
}>) {
  const pathname=usePathname()
  const router=useRouter()
  const [collapsed, setCollapsed] = useState(false);
  const {
    token: { colorBgContainer, borderRadiusLG },
  } = theme.useToken();
  return (
    <html>
      <body>
        
    <Layout style={{height:'100vh'}}>
      <Sider style={{background:'#fff'}} trigger={null} collapsible collapsed={collapsed}>
        <div className="demo-logo-vertical" />
        <p>客户管理</p>
        <Menu
          theme="light"
          mode="inline"
          defaultSelectedKeys={[pathname]}
          onSelect={(obj)=>{
            router.push(obj.key)
          }}
          items={[
            {
              key: '/cqq/qq',
              label: '客户列表',
            },
            {
              key: '/cqq/gonghai',
              label: '公海客户',
            },
            {
              key: '/cqq/laji',
              label: '垃圾客户',
            },
            {
              key: '/cqq/shaixuan',
              label: '客户筛选',
            },
            {
              key: '/cqq/xiaoshou',
              label: '销售线索',
            },
            {
              key: '/cqq/gonggong',
              label: '公共线索',
            },
            {
              key: '/cqq/lianxi',
              label: '联系人列表',
            },
            {
              key: '/cqq/genjin',
              label: '跟进记录',
            },
           
          ]}
        />
      </Sider>
      <Layout>
        
        <Content
          style={{
            margin: '24px 16px',
            padding: 24,
            minHeight: 280,
            background: colorBgContainer,
            borderRadius: borderRadiusLG,
          }}
        >
          {children}
        </Content>
      </Layout>
    </Layout>
      </body>
    </html>
  );
}
